package com.foreknow.elmboot.mapper;

import com.foreknow.elmboot.po.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

@Mapper
public interface UserMapper {
    //根据用户编号与密码查询用户信息
    @Select("select * from user where userId=#{userId} and password=#{password}")
    public User query(String userId, String password);
    //根据用户编号查询用户表返回的行数
    @Select("select count(*) from user where userId=#{userId}")
    public int queryrow(String userId);
    //向用户表中添加一条记录
    @Insert("insert into user(userId,password,userName,userSex)values (#{userId},#{password},#{userName},#{userSex})")
    public int uinsert(User user);
}
